package com.catazy.jetpackstudy.act2.chapter2.serial;

import java.io.Serializable;

/**
 * - 作者: Tao
 * - 日期: 2025/1/15
 * - 时间: 09:40
 * - 描述: 用户实体类，实现Serializable接口，保证数据序列化
 */
public class User implements Serializable {

    private static final long serialVersionUID = 519067123721295773L;

    private int userId;

    private String name;

    private boolean isMale;

    public User(int userId, String name, boolean isMale) {
        this.userId = userId;
        this.name = name;
        this.isMale = isMale;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", name='" + name + '\'' +
                ", isMale=" + isMale +
                '}';
    }
}
